package com.mgr.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

import com.mgr.service.SendMail;

public class SendMailImpl implements SendMail {
	@Autowired
	private JavaMailSender mailSender;

	@Override
	public void sendEmail(String custName, String verifyLink ,String emailAdd) {

		String content="Hi "+custName+"\n";
		content+="You recently joined one of the ABC-bank services.\n";
		content+="To confirm your email address, click on the link below:\n";
		content+=verifyLink;
		
		SimpleMailMessage eMessage=new SimpleMailMessage();
		eMessage.setTo(emailAdd);
		eMessage.setSubject("Verify your mail address with ABC-bank service");
		eMessage.setText(content);
		
		mailSender.send(eMessage);

	}

}